{extend name="admin/base" /}
{block name="resources"/}
<link rel="stylesheet" type="text/css" href="ADMIN_CSS/product.css">
<style type="text/css">
.fun-a {
	margin-top: 0px;
	padding: 6px 15px 0 15px;
}
.style0list tbody td a{
	margin-left: 8px;
}
.num{width:40px;text-align:center;}	
.cell_total{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:250px;display: block;}
.style0list table input {
	margin-bottom: 0px;
}

.style0list table input.sort {
	width: auto;
	text-align: center;
}

.style0list tbody td {
	line-height: 28px;
}
</style>
{/block}
{block name="right_tab"}

{/block}
{block name="main"}
<div class="mod-table">
	<div class="mod-table-head">
		<div class="con style0list">
			<table>
				 <colgroup>
					<col style="width: 30%;">
					<col style="width: 20%;">
					<col style="width: 20%;">
					<col style="width: 30%;">
				</colgroup>
				<thead>
					<tr align="center">
						<th class="x-tab"><div class="iconbg-arrow up">文件名称</div></th>
						<th class="x-tab"><div class="iconbg-arrow up">备份时间</div></th>
						<th class="x-tab"><div class="iconbg-arrow up">文件大小</div></th>
						<th class="x-tab">操作</th>
					</tr>
				</thead>
				<tbody></tbody>
			</table>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<!-- {include file="admin/pageCommon" /} -->
<script type="text/javascript">
//分页数据
function LoadingInfo(page_index) {
	//var search_text = $("#search_text").val();
	$.ajax({
		type : "post",
		url : "ADMIN_MAIN/Config/importDataList",
		async : true,
		success : function(data) {
			var is_null = true;
			//alert(JSON.stringify(data));
			var html = '';
			$.each(data, function(key, val) {
				is_null = false;
				html += '<tr align="center">';
				html += '<td>'+ val["date_time"]+'</td>';	
				html += '<td>'+ key+ '</td>';
				html += '<td>'+ val["data_size"]+ '</td>';
				html += '<td><a href="javascript:;" onclick="recorvery('+ val["date_time"]+')">恢复</a><a href="javascript:;" onclick="del('+ val["date_time"]+')">删除</a></td> ';
				html += '</tr>';
			});				
			if(is_null){
				html += '<tr align="center"><th colspan="9">暂无列表</th></tr>';				
			}
			
			$(".style0list tbody").html(html);
			//initPageData(data["page_count"],data['data'].length,data['total_count']);
			//$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
			//load();
		}
	});
}	

/* function batchDelete() {
	var article_id= new Array();
	$(".style0list tbody input[type='checkbox']:checked").each(function() {
		if (!isNaN($(this).val())) {
			article_id.push($(this).val());
		}
	});
	if(article_id.length ==0){
		$( "#dialog" ).dialog({
			buttons: {
				"确定,#e57373": function() {
					$(this).dialog('close');
				}
			},
			contentText:"请选择需要操作的记录",
			title:"消息提醒",
		});
		return false;
	}
	deleteArticle(article_id);
}
var flag = false; */
//删除分类
function del(dir_name){
	$( "#dialog" ).dialog({
		buttons: {
			"确定": function() {
				$(this).dialog('close');
				if(!flag){
					flag = true;
					$.ajax({
						type : "post",
						url : "",
						data : {
							"dir_name" : dir_name
						},
						dataType : "json",
						success : function(data) {
							if (data["code"] > 0) {
								showMessage('success', data["message"]);
								LoadingInfo(getCurrentIndex(article_id,'.style0list tbody'));
							}else{
								showMessage('error', data["message"]);
							}
							flag = false;
						}
					})
				}
			},
			"取消,#e57373": function() {
				$(this).dialog('close');
			}
		},
	contentText:"是否删除文件？",
	});
}
//恢复
function recorvery(dir_name){
	$( "#dialog" ).dialog({
		buttons: {
			"确定": function() {
				$(this).dialog('close');
				if(!flag){
					flag = true;
					$.ajax({
						type : "post",
						url : "",
						data : {
							"dir_name" : dir_name
						},
						dataType : "json",
						success : function(data) {
							if (data["code"] > 0) {
								showMessage('success', data["message"]);
								LoadingInfo(getCurrentIndex(article_id,'.style0list tbody'));
							}else{
								showMessage('error', data["message"]);
							}
							flag = false;
						}
					})
				}
			},
			"取消,#e57373": function() {
				$(this).dialog('close');
			}
		},
	contentText:"是否恢复文件？",
	});
}

/*修改排序*/
/* function load(){
	$('.num').change(function(){
		var fieldid = $(this).attr('fieldid');
		var sort = $(this).val();
		$.ajax({
			type:"post",
			url:"ADMIN_MAIN/Cms/modifyArticleField",
			data:{'fieldid':fieldid,'sort':sort},
			async:true,
			success: function (data) {
				if(data['code'] <= 0){
					showMessage('error', data["message"]);
				}
			}
		});
	});
} */
//全选
/* function CheckAll(event){
	var checked = event.checked;
	$(".style0list tbody input[type = 'checkbox']").prop("checked",checked);
} */
function searchData(){
	LoadingInfo(1);
}
</script>
{/block}